package com.ruoyi.web.controller.com;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.domain.OperateBasicForm;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.ruoyi.com.domain.ComBusinessStyle;
import com.ruoyi.com.service.IComBusinessStyleService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 业务管理-样式设置Controller
 *
 * @author sunye
 * @date 2024-12-07
 */
@RestController
@RequestMapping("/com/comBusinessStyle")
@Api(tags = "业务管理-样式设置")
public class ComBusinessStyleController extends BaseController
{
    @Autowired
    private IComBusinessStyleService comBusinessStyleService;

    /**
     * 获取业务管理-样式设置信息
     */
    @ApiOperation(value = "获取业务管理-样式设置信息")
    @GetMapping(value = "/getInfo")
    public AjaxResult getInfo(ComBusinessStyle comBusinessStyle)
    {
        comBusinessStyle.setDeptId(getDeptId());
        //comBusinessStyle.setSmallId(getSmallId());
        return success(comBusinessStyleService.selectComBusinessStyle(comBusinessStyle));
    }

    /**
     * 新增业务管理-样式设置
     */
    @ApiOperation(value = "新增业务管理-样式设置")
    @Log(title = "业务管理-样式设置", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody ComBusinessStyle comBusinessStyle)
    {
        comBusinessStyle.setCreateId(getUserId());
        comBusinessStyle.setDeptId(getDeptId());
        //comBusinessStyle.setSmallId(getSmallId());
        return toAjax(comBusinessStyleService.insertComBusinessStyle(comBusinessStyle));
    }

    /**
     * 修改业务管理-样式设置
     */
    @ApiOperation(value = "修改业务管理-样式设置")
    @Log(title = "业务管理-样式设置", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody ComBusinessStyle comBusinessStyle)
    {
        comBusinessStyle.setUpdateId(getUserId());
        return toAjax(comBusinessStyleService.updateComBusinessStyle(comBusinessStyle));
    }

//    /**
//     * 删除业务管理-样式设置
//     */
//    @ApiOperation(value = "删除业务管理-样式设置")
//    @Log(title = "业务管理-样式设置", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{styleIds}")
//    public AjaxResult remove(@PathVariable Long[] styleIds)
//    {
//        return toAjax(comBusinessStyleService.deleteComBusinessStyleByStyleIds(styleIds));
//    }
//
//
//    /**
//     * 置为有效/无效业务管理-样式设置
//     */
//    @Log(title = "置为无效业务管理-样式设置", businessType = BusinessType.UPDATE)
//    @PostMapping("effectiveStatus")
//    public AjaxResult effectiveStatus(@RequestBody OperateBasicForm operateBasicForm)
//    {
//        return toAjax(comBusinessStyleService.effectiveStatus(operateBasicForm));
//    }
}
